package com.yys.apm.logger;

/**
 * @author Yingsheng Ye
 * @date 2021-03-22 17:07
 */
public class DefaultLoggerImpl extends AbstractLogger implements ILogger {

    private Class<?> clazz;

    DefaultLoggerImpl(Class<?> clazz) {
        this.clazz = clazz;
    }

    @Override
    public void info(String format, Object... arguments) {
        this.printLog(LogLevel.INFO, String.format(format, arguments), null);
    }

    @Override
    public void error(Throwable e, String format, Object... arguments) {
        this.printLog(LogLevel.ERROR, String.format(format, arguments), e);
    }

    @Override
    protected String getClassName() {
        return clazz.getName();
    }
}
